home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch7s < prev    next >
Encoding:
Internet Message Format  |  1990-02-26  |  55.9 KB

  1. Path: uunet!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think!mintaka!mit-eddie!uw-beaver!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v09i019:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch7s
  5. Message-ID: <5233@tekred.CNA.TEK.COM>
  6. Date: 24 Feb 90 01:01:59 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1969
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 9, Issue 19
  13. Archive-name: NetHack3/Patch7s
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 19 (of 30)."
  25. # Contents:  patch7.13
  26. # Wrapped by billr@saab on Wed Feb 21 10:04:40 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patch7.13' -a "${1}" != "-c" ; then 
  29.   echo shar: Renaming existing file \"'patch7.13'\" to \"'patch7.13.orig'\"
  30.   mv -f 'patch7.13' 'patch7.13.orig'
  31. fi
  32. echo shar: Extracting \"'patch7.13'\" \(53324 characters\)
  33. sed "s/^X//" >'patch7.13' <<'END_OF_FILE'
  34. X*** /dev/null    Mon Feb 19 16:50:00 1990
  35. X--- amiga/NHScore.uu    Sun Feb 11 12:22:05 1990
  36. X***************
  37. X*** 0 ****
  38. X--- 1,44 ----
  39. X+ begin 644 NetHackScore.info
  40. X+ MXQ   0      ) !) %  *P &  ,  0 C!#  (P9(                    
  41. X+ M    !/X (P&P "*'P    ,H    ^             )Q       !0 "H  @ !
  42. X+ MH4@#                                                /______X
  43. X+ M!X   /\\__]__?_\  #_'/_^?_W__P  _PSP?!_Y__\  ?\DYSY_^_S_@ #_
  44. X+ M,. ^?_G^?X  _SCG_F_]_S^  '\\\'\?_/^_@  ?______X_OX          
  45. X+ M '^     '_______@    !_______P     _______\     (&#@Q'!^    
  46. X+ M $_.3F,G/@    #@S\YG(#P     _DY.9^?X     <#@X,/P>     /_____
  47. X+ M__     #_______@    !_______X     _______\     /______^     
  48. X+ M      '_@  '_______"_P  #_______GWX  !YS___Q_[Y^   ^<___^?]\
  49. X+ M_   /G.#\'G/?_@  #X#^><YGT?X   ^<\'G^#\/\   /G,YYSF??^   !YS
  50. X+ MA/!QSS^    /______^?    !_______S                           
  51. X+ M                                                          !_
  52. X+ M______S_P   P      '^'P  0##  "  @ #  $ XP !@ (  ( # /,/@^ &
  53. X+ M  #  @#;&,& ! , 0 , SQ_!@ 8!@$ ! ,<8 9 " ,!  8###X#@ P! 0 #@
  54. X+ M      ' 0$  /________X!     (       0    &       ,    !     
  55. X+ M  "     WY\?.X^!@    + QL9S8P0    $?,#&8W\(    # ;&QF!@&    
  56. X+ M C\?'SP/A     0       @    ,       8    "       $    !      
  57. X+ M "     P      !@  ?_______X 0  8       ] ,  ,       8(&  "&,
  58. X+ M   . $&!  !!C   !@"# P  08Q\#X8P@ 8  $'\!AC&8,0$  !!C#X8!\" 
  59. X+ M"   08S&&,9@@!@  &&,>P^.,,!P   P      !@P   &       ,X    ?_
  60. X+ M______X                                                  %  
  61. X+ M*@ "  &DD ,                                                _
  62. X+ M______@'@   _SS__W_]__P  /\<__Y__ /_  #_#/!\'_@ /P !_R3G/G_X
  63. X+ M  >  /\PX#Y_^     #_..?^;_P     ?SSP?Q_\X    !_______C@     
  64. X+ M        8#     ?_____@      '_____X      #______       @8.#$
  65. X+ M< ,     3\Y.8R<#     .#/SF<@(P    #^3DYGY_L    !P.#@P_!_@   
  66. X+ M ________.    /______^     '_______@    #_______P     ______
  67. X+ M_X           ?^   ?______\+_   /______^??@  'G/___'_OAX  #YS
  68. X+ M___Y_WS<   ^<X/P><]#N   /@/YYSF?3O@  #YSP>?X/P'P   ^<SGG.9]_
  69. X+ MX   'G.$\''//X    _______Y\    '_______,                    
  70. X+ M                                                            
  71. X+ M     '_______/_   #       ?X?  ! ,,  ( "  ,  0#C  &  _P @ , 
  72. X+ M\P^#X 8#P, " -L8P8 $ #A  P#/'\& !@ 'P $ QQ@!D (  '@!@,,/@. #
  73. X+ M   & .       <   @ _________X#(    @     0 "    8     $_\@  
  74. X+ M $      C^0   #?GQ\[C\.(    L#&QG-CC<    1\P,9C?WX    ,!L;&8
  75. X+ M& <    "/Q\?/ ^'@   !       '.    P      !@    (       0    
  76. X+ M$       (    #       &  !________@!  !@      #T P  P      !@
  77. X+ M@8  (8P   X 08$  $&,   & (/#  !!C'P/AC"#A@  0?P&&,9@S@0  $&,
  78. X+ M/A@'P( (  !!C,88QF" &   88Q[#XXPP'   #       &#    8       S
  79. X+ M@   !________@                                              
  80. X+ @ !!(86-K17AE.DYE=$AA8VL     "     930T]210  
  81. X+  
  82. X+ end
  83. X*** /dev/null    Mon Feb 19 16:50:11 1990
  84. X--- amiga/NHinfo.uu    Sat Jan 20 16:42:21 1990
  85. X***************
  86. X*** 0 ****
  87. X--- 1,43 ----
  88. X+ begin 644 NetHack.info
  89. X+ MXQ   0     "$@ 2 %  *P &  ,  0 C>P  (WN@                    
  90. X+ M     R(              @X    '             )Q       !0 "H  @ !
  91. X+ M@;@#      #_____________^/____QC___X__@____\8___^/_X#____&/_
  92. X+ M__C_^,/___QC___X__CP___\8___^/_X_#___&/___C_^/\/__QC___X__C_
  93. X+ MP__\8___^/_X__#__&    #_^/_\/_Q@    __C__P_\8___^/_X___#_&/_
  94. X+ M__C_^/__\/QC___X__C___P  !__^/_X___\   '__C_^/__^ !CX'_X__C_
  95. X+ M__ 08_@?^/_X___P_&/^#_C_____\/___X________/____'____________
  96. X+ MX____________^/________\  ?#________^  !C_________!_P!______
  97. X+ M___P__ _________^   /_________X #A____________\/____________
  98. X+ M#____________P?___________^'____________A________/___X?_____
  99. X+ M__@/__^/_______\ __\#________@#_X#_________ '@#__________@ ?
  100. X+ M______________________________\             !P    .<   '  ? 
  101. X+ M   #G   !P '\    YP   < !SP   .<   '  </   #G   !P ' \   YP 
  102. X+ M  < !P#P  .<   '  < /  #G   !P '  \  Y____\ !P #P .?____  < 
  103. X+ M / #G   !P '   \ YP   < !P  #P.<   '  <   ,     !P '        
  104. X+ M  < !P   !*<   '  <    /G   !P '     YP   <                 
  105. X+ M                                                            
  106. X+ M                                                            
  107. X+ M                                                            
  108. X+ M                                                            
  109. X+ M                                                         %  
  110. X+ M*@ "  &%  ,      /_____________X_____&/___C_^#____QC___X__@/
  111. X+ M___\8___^/_XP____&/___C_^/#___QC___X__C\/__\8___^/_X_P___&/_
  112. X+ M__C_^/_#__QC___X__C_\/_\8    /_X__P__&    #_^/__#_QC___X__C_
  113. X+ M_\/\8___^/_X___P_&/___C_^/___   '__X__C___@   ?_^/_X__^  &/@
  114. X+ M?_C_^/_  !!C^!_X__C^  #\8_X/^/__^   ____C_____,!D____\?____X
  115. X+ M !_____C____^  ?____X_____P /_P !\/____^&'_X  &/_____QO_\'_ 
  116. X+ M'_________#_\#_________X   __________@ .'____________P______
  117. X+ M______\/____________!____________X?___________^'_______\____
  118. X+ MA_______^ ___X________P#__P/_______^ /_@/________\ > /______
  119. X+ M___^ !_______________________________P             '     YP 
  120. X+ M  < !\    .<   '  ?P   #G   !P '/    YP   < !P\   .<   '  <#
  121. X+ MP  #G   !P ' /   YP   < !P \  .<   '  < #P #G____P '  /  Y__
  122. X+ M__\ !P  \ .<   '  <  #P#G   !P '   / YP   < !P   P     '  < 
  123. X+ M        !P '    $IP   < !P    ^<   '  <    #G   !P          
  124. X+ M      ,!@                        ?^           !_            
  125. X+ M'            !@            8            &            #P     
  126. X+ M      #G                                                    
  127. X+ M                                                            
  128. X+ K                                                            
  129. X+  
  130. X+ end
  131. X*** /dev/null    Mon Feb 19 16:50:28 1990
  132. X--- amiga/NewGame.uu    Sun Feb 11 12:22:18 1990
  133. X***************
  134. X*** 0 ****
  135. X--- 1,44 ----
  136. X+ begin 644 NewGame.info
  137. X+ MXQ   0      D0 2 %  *P &  ,  0 BTP  (P&8                    
  138. X+ M    !/X (M-@         3<    '             )Q       !0 "H  @ !
  139. X+ M@^@#      #_____________^/____QC___X__@____\8___^/_X#____&/_
  140. X+ M__C_^,/___QC___X__CP___\8___^/_X_#___&/___C_^/\/__QC___X__C_
  141. X+ MP__\8___^/_X__#__&    #_^/_\/_Q@    __C__P_\8___^/_X___#_&/_
  142. X+ M__C_^/__\/QC___X__C___P  !__^/_X___\   '__C_^/__^ !CX'_X__C_
  143. X+ M__ 08_@?^/_X___P_&/^#_C_____\/___X________/____'____\#______
  144. X+ MX_____.?_____^/____SG__\  ?#____\Y__^  !C_____.?__!_P!______
  145. X+ M___P__ _____^#__^   /_____.?__X #A_____P'_____\/____\_______
  146. X+ M#_____@______P?___________^'____YY______A____^2?_/___X?____D
  147. X+ MG_@/__^/____\S_\ __\#_____,__@#_X#_________ '@#__________@ ?
  148. X+ M______________________________\             !P    .<   '  ? 
  149. X+ M   #G   !P '\    YP   < !SP   .<   '  </   #G   !P ' \   YP 
  150. X+ M  < !P#P  .<   '  < /  #G   !P '  \  Y____\ !P #P .?____  < 
  151. X+ M / #G   !P '   \ YP   < !P  #P.<   '  <   ,     !P '        
  152. X+ M  < !P   !*<   '  <    /G   !P '     YP   <                 
  153. X+ M            #\            Q@           ,8           #&      
  154. X+ M      Q@                        !\            Q@           /
  155. X+ MX           #             ?                         &&      
  156. X+ M     !M@           ;8           #,            S             
  157. X+ M                                                         %  
  158. X+ M*@ "  &7< ,      /_____________X_____&/___C_^#____QC___X__@/
  159. X+ M___\8___^/_XP____&/___C_^/#___QC___X__C\/__\8___^/_X_P___&/_
  160. X+ M__C_^/_#__QC___X__C_\/_\8    /_X__P__&    #_^/__#_QC___X__C_
  161. X+ M_\/\8___^/_X___P_&/___C_^/___   '__X__C___@   ?_^/_X__^  &/@
  162. X+ M?_C_^/_  !!C^!_X__C^  #\8_X/^/__^   ____C_____,!D____\?____X
  163. X+ M !_____C____^  ?____X_____P /_P !\/____\ '_X  &/_____ #_\'_ 
  164. X+ M'_____S\__#_\#______!__X   ______G/__@ .'_____X#_____P_____^
  165. X+ M?_____\/_____P?_____!____________X?____^>?____^'_____DG\____
  166. X+ MA_____Y)^ ___X______,_P#__P/_____S/^ /_@/________\ > /______
  167. X+ M___^ !_______________________________P             '     YP 
  168. X+ M  < !\    .<   '  ?P   #G   !P '/    YP   < !P\   .<   '  <#
  169. X+ MP  #G   !P ' /   YP   < !P \  .<   '  < #P #G____P '  /  Y__
  170. X+ M__\ !P  \ .<   '  <  #P#G   !P '   / YP   < !P   P     '  < 
  171. X+ M        !P '    $IP   < !P    ^<   '  <    #G   !P          
  172. X+ M      ,!@                                                   
  173. X+ M             P$           ,;            ^            ;P     
  174. X+ M      '_           !@            /@                        !
  175. X+ MA@           ;8           &V            S            ,P     
  176. X+ M                                                            
  177. X+ 2 !!(86-K17AE.DYE=$AA8VL 
  178. X+  
  179. X+ end
  180. X*** amiga/Old/amidos.c    Mon Feb 19 16:50:52 1990
  181. X--- amiga/amidos.c    Wed Jan 31 19:26:06 1990
  182. X***************
  183. X*** 3,9 ****
  184. X  /* An assortment of imitations of cheap plastic MSDOS functions.
  185. X   */
  186. X  
  187. X! #include <libraries/dos.h>
  188. X  
  189. X  #undef TRUE
  190. X  #undef FALSE
  191. X--- 3,10 ----
  192. X  /* An assortment of imitations of cheap plastic MSDOS functions.
  193. X   */
  194. X  
  195. X! #define NEED_VARARGS
  196. X! #include "hack.h"
  197. X  
  198. X  #undef TRUE
  199. X  #undef FALSE
  200. X***************
  201. X*** 10,25 ****
  202. X  #undef COUNT
  203. X  #undef NULL
  204. X  
  205. X! #define NEED_VARARGS
  206. X! #include "hack.h"
  207. X  
  208. X  extern char Initialized;
  209. X  
  210. X! struct FileLock *Lock(), *CurrentDir(); /* Cheating - BCPL pointers */
  211. X! struct FileHandle *Open();              /* Cheating - BCPL pointer */
  212. X! long Read(), Write(), IoErr(), AvailMem();
  213. X! void *malloc();
  214. X! char *rindex(), *index();
  215. X  
  216. X  int Enable_Abort = 0;    /* for stdio package */
  217. X  
  218. X--- 11,65 ----
  219. X  #undef COUNT
  220. X  #undef NULL
  221. X  
  222. X! #include <libraries/dos.h>
  223. X! #ifdef LATTICE
  224. X! #include <proto/exec.h>
  225. X! #include <proto/dos.h>
  226. X! #endif
  227. X  
  228. X+ /* Prototypes for functions defined in amidos.c */
  229. X+ void NDECL (flushout);
  230. X+ int NDECL (getpid);
  231. X+ int FDECL (abs, (int x));
  232. X+ int NDECL (tgetch);
  233. X+ int NDECL (dosh);
  234. X+ long FDECL (freediskspace, (char *path));
  235. X+ long FDECL (filesize, (char *file));
  236. X+ void FDECL (eraseall, (char *path,
  237. X+               char *files));
  238. X+ char *FDECL (CopyFile, (char *from,
  239. X+                char *to));
  240. X+ void FDECL (copybones, (int mode));
  241. X+ void NDECL (playwoRAMdisk);
  242. X+ int FDECL (saveDiskPrompt, (int start));
  243. X+ void NDECL (gameDiskPrompt);
  244. X+ void NDECL (read_config_file);
  245. X+ void NDECL (set_lock_and_bones);
  246. X+ void FDECL (append_slash, (char *name));
  247. X+ void FDECL (getreturn, (char *str));
  248. X+ void VDECL (msmsg, (char *fmt, ...));
  249. X+ FILE * FDECL (fopenp, (char *name,
  250. X+                       char *mode));
  251. X+ int FDECL (chdir, (char *dir));
  252. X+ void FDECL (msexit, (int code));
  253. X+ static boolean NDECL (record_exists);
  254. X+ static int FDECL (strcmpi, (register char *a, register char *b));
  255. X+ 
  256. X  extern char Initialized;
  257. X  
  258. X! #ifdef AZTEC_C
  259. X! struct DateStamp *FDECL(DateStamp, (struct DateStamp *));
  260. X! BPTR FDECL(Lock, (char *, long));
  261. X! BPTR FDECL(CurrentDir, (BPTR));
  262. X! BPTR FDECL(Open, (char *, long));
  263. X! long FDECL(Read, (BPTR, char *, long));
  264. X! long FDECL(Write, (BPTR, char *, long));
  265. X! long NDECL(IoErr);
  266. X! long FDECL(AvailMem, (long));
  267. X! void *FDECL(malloc, (unsigned int));
  268. X! char *FDECL(rindex, (char *, int));
  269. X! char *FDECL(index, (char *, int));
  270. X! #endif
  271. X  
  272. X  int Enable_Abort = 0;    /* for stdio package */
  273. X  
  274. X***************
  275. X*** 52,58 ****
  276. X      while (pid == 0) {
  277. X      struct DateStamp dateStamp;
  278. X      pid = rnd(30000);
  279. X!     pid += DateStamp(&dateStamp);    /* More or less random */
  280. X      pid ^= (short) (dateStamp.ds_Days >> 16) ^
  281. X             (short) (dateStamp.ds_Days)       ^
  282. X             (short) (dateStamp.ds_Minute)     +
  283. X--- 92,98 ----
  284. X      while (pid == 0) {
  285. X      struct DateStamp dateStamp;
  286. X      pid = rnd(30000);
  287. X!     pid += (short) DateStamp(&dateStamp);    /* More or less random */
  288. X      pid ^= (short) (dateStamp.ds_Days >> 16) ^
  289. X             (short) (dateStamp.ds_Days)       ^
  290. X             (short) (dateStamp.ds_Minute)     +
  291. X***************
  292. X*** 60,66 ****
  293. X      pid %= 30000;
  294. X      }
  295. X  
  296. X!     return pid;
  297. X  }
  298. X  
  299. X  #ifndef getlogin
  300. X--- 100,106 ----
  301. X      pid %= 30000;
  302. X      }
  303. X  
  304. X!     return (int)pid;
  305. X  }
  306. X  
  307. X  #ifndef getlogin
  308. X***************
  309. X*** 139,146 ****
  310. X          fileName[0] = '\0';
  311. X      }
  312. X  
  313. X!     if (infoData = malloc(sizeof(*infoData))) {
  314. X!     struct FileLock *fileLock;  /* Cheating */
  315. X      if (fileLock = Lock(fileName, SHARED_LOCK)) {
  316. X          if (Info(fileLock, infoData)) {
  317. X          /* We got a kind of DOS volume, since we can Lock it. */
  318. X--- 179,186 ----
  319. X          fileName[0] = '\0';
  320. X      }
  321. X  
  322. X!     if (infoData = malloc(sizeof(struct InfoData))) {
  323. X!     BPTR fileLock;
  324. X      if (fileLock = Lock(fileName, SHARED_LOCK)) {
  325. X          if (Info(fileLock, infoData)) {
  326. X          /* We got a kind of DOS volume, since we can Lock it. */
  327. X***************
  328. X*** 174,184 ****
  329. X  filesize(file)
  330. X  char *file;
  331. X  {
  332. X!     register struct FileLock *fileLock;
  333. X      register struct FileInfoBlock *fileInfoBlock;
  334. X      register long size = 0;
  335. X  
  336. X!     if (fileInfoBlock = malloc(sizeof(*fileInfoBlock))) {
  337. X      if (fileLock = Lock(file, SHARED_LOCK)) {
  338. X          if (Examine(fileLock, fileInfoBlock)) {
  339. X          size = fileInfoBlock->fib_Size;
  340. X--- 214,224 ----
  341. X  filesize(file)
  342. X  char *file;
  343. X  {
  344. X!     register BPTR fileLock;
  345. X      register struct FileInfoBlock *fileInfoBlock;
  346. X      register long size = 0;
  347. X  
  348. X!     if (fileInfoBlock = malloc(sizeof(struct FileInfoBlock))) {
  349. X      if (fileLock = Lock(file, SHARED_LOCK)) {
  350. X          if (Examine(fileLock, fileInfoBlock)) {
  351. X          size = fileInfoBlock->fib_Size;
  352. X***************
  353. X*** 201,209 ****
  354. X  {
  355. X      char buf[FILENAME];
  356. X      short i;
  357. X!     struct FileLock *fileLock, *dirLock;
  358. X  
  359. X!     if (dirLock = Lock(path)) {
  360. X      dirLock = CurrentDir(dirLock);
  361. X  
  362. X      strcpy(buf, files);
  363. X--- 241,249 ----
  364. X  {
  365. X      char buf[FILENAME];
  366. X      short i;
  367. X!     BPTR fileLock, dirLock;
  368. X  
  369. X!     if (dirLock = Lock(path ,SHARED_LOCK)) {
  370. X      dirLock = CurrentDir(dirLock);
  371. X  
  372. X      strcpy(buf, files);
  373. X***************
  374. X*** 227,233 ****
  375. X  char *CopyFile(from, to)
  376. X  char *from, *to;
  377. X  {
  378. X!     register struct FileHandle *fromFile, *toFile;
  379. X      register char *buffer;
  380. X      register long size;
  381. X      char *error = NULL;
  382. X--- 267,273 ----
  383. X  char *CopyFile(from, to)
  384. X  char *from, *to;
  385. X  {
  386. X!     register BPTR fromFile, toFile;
  387. X      register char *buffer;
  388. X      register long size;
  389. X      char *error = NULL;
  390. X***************
  391. X*** 257,263 ****
  392. X  copybones(mode)
  393. X  int mode;
  394. X  {
  395. X!     struct FileLock *fileLock;
  396. X      char from[FILENAME], to[FILENAME];
  397. X      char *frompath, *topath, *status;
  398. X      short i;
  399. X--- 297,303 ----
  400. X  copybones(mode)
  401. X  int mode;
  402. X  {
  403. X!     BPTR fileLock;
  404. X      char from[FILENAME], to[FILENAME];
  405. X      char *frompath, *topath, *status;
  406. X      short i;
  407. X***************
  408. X*** 336,342 ****
  409. X  {
  410. X      extern int saveprompt;
  411. X      char buf[BUFSIZ], *bp;
  412. X!     struct FileLock *fileLock;
  413. X  
  414. X      if (saveprompt) {
  415. X      /* Don't prompt if you can find the save file */
  416. X--- 376,382 ----
  417. X  {
  418. X      extern int saveprompt;
  419. X      char buf[BUFSIZ], *bp;
  420. X!     BPTR fileLock;
  421. X  
  422. X      if (saveprompt) {
  423. X      /* Don't prompt if you can find the save file */
  424. X***************
  425. X*** 413,419 ****
  426. X  {
  427. X      char    tmp_ramdisk[PATHLEN], tmp_levels[PATHLEN];
  428. X      char    buf[BUFSZ], *bufp;
  429. X!     FILE    *fp, *fopenp();
  430. X      extern  char plname[];
  431. X      extern  int saveprompt;
  432. X  
  433. X--- 453,459 ----
  434. X  {
  435. X      char    tmp_ramdisk[PATHLEN], tmp_levels[PATHLEN];
  436. X      char    buf[BUFSZ], *bufp;
  437. X!     FILE    *fp;
  438. X      extern  char plname[];
  439. X      extern  int saveprompt;
  440. X  
  441. X***************
  442. X*** 567,574 ****
  443. X--- 607,629 ----
  444. X  msmsg VA_DECL(char *, fmt)
  445. X      VA_START(fmt);
  446. X      VA_INIT(fmt, char *);
  447. X+ #ifdef LATTICE
  448. X+     {
  449. X+     extern struct Screen *HackScreen;
  450. X+     char buf[100];
  451. X+     vsprintf(buf,fmt,VA_ARGS);
  452. X+     if(HackScreen){
  453. X+         WindowFPuts(buf);
  454. X+         WindowFlush();
  455. X+     } else {
  456. X+         fprintf(stdout,buf);
  457. X+         fflush(stdout);
  458. X+     }
  459. X+     }
  460. X+ #else
  461. X      vprintf(fmt, VA_ARGS);
  462. X      (void) fflush(stdout);
  463. X+ #endif
  464. X      VA_END();
  465. X  }
  466. X  
  467. X***************
  468. X*** 583,589 ****
  469. X  {
  470. X      char buf[BUFSIZ], *bp, *pp, lastch;
  471. X      FILE *fp;
  472. X!     register struct FileLock *theLock;
  473. X  
  474. X      /* Try the default directory first.  Then look along PATH.
  475. X       */
  476. X--- 638,644 ----
  477. X  {
  478. X      char buf[BUFSIZ], *bp, *pp, lastch;
  479. X      FILE *fp;
  480. X!     register BPTR theLock;
  481. X  
  482. X      /* Try the default directory first.  Then look along PATH.
  483. X       */
  484. X***************
  485. X*** 622,631 ****
  486. X   *  Assumes -1 is not a valid lock, since 0 is valid.
  487. X   */
  488. X  
  489. X! #define NO_LOCK     ((struct FileLock *) -1)
  490. X  
  491. X  char orgdir[1];
  492. X! static struct FileLock *OrgDirLock = NO_LOCK;
  493. X  
  494. X  chdir(dir)
  495. X  char *dir;
  496. X--- 677,686 ----
  497. X   *  Assumes -1 is not a valid lock, since 0 is valid.
  498. X   */
  499. X  
  500. X! #define NO_LOCK     ((BPTR) -1)
  501. X  
  502. X  char orgdir[1];
  503. X! static BPTR OrgDirLock = NO_LOCK;
  504. X  
  505. X  chdir(dir)
  506. X  char *dir;
  507. X***************
  508. X*** 641,647 ****
  509. X       * Go to some new place. If still at the original
  510. X       * directory, save the FileLock.
  511. X       */
  512. X!     struct FileLock *newDir;
  513. X  
  514. X      if (newDir = Lock(dir, SHARED_LOCK)) {
  515. X          if (OrgDirLock == NO_LOCK) {
  516. X--- 696,702 ----
  517. X       * Go to some new place. If still at the original
  518. X       * directory, save the FileLock.
  519. X       */
  520. X!     BPTR newDir;
  521. X  
  522. X      if (newDir = Lock(dir, SHARED_LOCK)) {
  523. X          if (OrgDirLock == NO_LOCK) {
  524. X***************
  525. X*** 702,708 ****
  526. X   *  memcmp - used to compare two struct symbols, in lev.c
  527. X   */
  528. X  
  529. X! #ifndef memcmp
  530. X  memcmp(a, b, size)
  531. X  register unsigned char *a, *b;
  532. X  register int size;
  533. X--- 757,763 ----
  534. X   *  memcmp - used to compare two struct symbols, in lev.c
  535. X   */
  536. X  
  537. X! #if defined(AZTEC_C) && !defined(memcmp)
  538. X  memcmp(a, b, size)
  539. X  register unsigned char *a, *b;
  540. X  register int size;
  541. X***************
  542. X*** 713,729 ****
  543. X      }
  544. X  
  545. X      return 0;        /* equal */
  546. X- }
  547. X- #endif
  548. X- 
  549. X- #ifndef memcpy
  550. X- char *
  551. X- memcpy(dest, source, size)
  552. X- register char *dest;
  553. X- char *source;
  554. X- int size;
  555. X- {
  556. X-     movmem(source, dest, size);
  557. X-     return dest;
  558. X  }
  559. X  #endif
  560. X--- 768,772 ----
  561. X*** amiga/Old/amimenu.c    Mon Feb 19 16:51:45 1990
  562. X--- amiga/amimenu.c    Thu Dec 28 17:27:08 1989
  563. X***************
  564. X*** 7,13 ****
  565. X  
  566. X  #define TEXT(nam,str) \
  567. X  static struct IntuiText nam = \
  568. X!   {0,1,JAM2,0,0,(struct TextAttr*)NULL,(UBYTE*)str,(struct IntuiText*)NULL}
  569. X  
  570. X      /* Commands */
  571. X      TEXT(T_HELP,  "?   Display help menu");
  572. X--- 7,13 ----
  573. X  
  574. X  #define TEXT(nam,str) \
  575. X  static struct IntuiText nam = \
  576. X!   {0,1,JAM2,0,0,0L,(UBYTE*)str,0L}
  577. X  
  578. X      /* Commands */
  579. X      TEXT(T_HELP,  "?   Display help menu");
  580. X***************
  581. X*** 64,70 ****
  582. X      TEXT(T_E,     "E   Engrave msg on floor");
  583. X  
  584. X  #define IFLAGS ITEMENABLED|ITEMTEXT|HIGHCOMP
  585. X! #define IDATA(cmd,str,off) 0,off,WDT,9,IFLAGS,0,(APTR)&str,NULL,cmd,(struct MenuItem*)NULL,0
  586. X  
  587. X  /* Commands */
  588. X  
  589. X--- 64,70 ----
  590. X      TEXT(T_E,     "E   Engrave msg on floor");
  591. X  
  592. X  #define IFLAGS ITEMENABLED|ITEMTEXT|HIGHCOMP
  593. X! #define IDATA(cmd,str,off) 0,off,WDT,9,IFLAGS,0,(APTR)&str,NULL,cmd,0L,0
  594. X  
  595. X  /* Commands */
  596. X  
  597. X*** amiga/Old/amitcap.c    Mon Feb 19 16:51:59 1990
  598. X--- amiga/amitcap.c    Wed Jan 31 19:25:16 1990
  599. X***************
  600. X*** 4,11 ****
  601. X--- 4,25 ----
  602. X  
  603. X  /* block some unused #defines to avoid overloading some cpp's */
  604. X  #define MONATTK_H
  605. X+ 
  606. X  #include "hack.h"       /* for ROWNO, COLNO, *HI, *HE, *AS, *AE */
  607. X  
  608. X+ #ifdef LATTICE
  609. X+ #undef TRUE
  610. X+ #undef FALSE
  611. X+ #undef COUNT
  612. X+ #undef NULL
  613. X+ #include <proto/dos.h>
  614. X+ #endif
  615. X+ 
  616. X+ #ifndef LATTICE
  617. X+ extern void FDECL(Delay, (unsigned long));
  618. X+ #endif
  619. X+ extern void NDECL(Initialize);
  620. X+ 
  621. X  static char HO[] = "\233H";         /* Home         CSI H */
  622. X  static char CL[] = "\f";            /* Clear        FF */
  623. X  static char CE[] = "\233K";         /* Erase EOL    CSI K */
  624. X***************
  625. X*** 17,23 ****
  626. X  static char ME[] = "\2330m";        /* Reverse off  CSI 0 m */
  627. X  
  628. X  #ifdef TEXTCOLOR
  629. X! static char SO[] = "\23333m";       /* Standout: Color #3 (orange) */
  630. X  static char SE[] = "\2330m";
  631. X  #else
  632. X  static char SO[] = "\2337m";        /* Inverse video */
  633. X--- 31,37 ----
  634. X  static char ME[] = "\2330m";        /* Reverse off  CSI 0 m */
  635. X  
  636. X  #ifdef TEXTCOLOR
  637. X! static char SO[] = "\23337m";       /* Use colormap entry #7 (red) */
  638. X  static char SE[] = "\2330m";
  639. X  #else
  640. X  static char SO[] = "\2337m";        /* Inverse video */
  641. X***************
  642. X*** 25,33 ****
  643. X  #endif
  644. X  
  645. X  #ifdef TEXTCOLOR
  646. X! /* color maps */
  647. X! static int foreg[8] = { 2, 3, 1, 3, 3, 3, 3, 0 };
  648. X! static int backg[8] = { 1, 2, 2, 0, 1, 1, 1, 1 };
  649. X  #endif
  650. X  
  651. X  void
  652. X--- 39,50 ----
  653. X  #endif
  654. X  
  655. X  #ifdef TEXTCOLOR
  656. X! /*
  657. X!  * Map our amiga-specific colormap into the colormap specified in color.h.
  658. X!  * See amiwind.c for the amiga specific colormap.
  659. X!  */
  660. X! static int foreg[16] = { 0, 7, 4, 2, 6, 5, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
  661. X! static int backg[16] = { 1, 0, 0, 0, 0, 0, 0, 0, 1, 7, 4, 2, 6, 5, 3, 1 };
  662. X  #endif
  663. X  
  664. X  void
  665. X***************
  666. X*** 35,71 ****
  667. X  {
  668. X  #ifdef TEXTCOLOR
  669. X      register int c;
  670. X! #endif  
  671. X! 
  672. X      (void) Initialize();        /* This opens screen, window, console, &c */
  673. X- 
  674. X      CO = COLNO;
  675. X      LI = ROWNO+3;               /* used in pri.c and pager.c */
  676. X  
  677. X      set_whole_screen();
  678. X- 
  679. X      CD = "\233J";               /* used in pager.c */
  680. X  
  681. X  #ifdef TEXTCOLOR
  682. X      /*
  683. X!      * We need 5 different 'colors', but in a 4-color screen we really
  684. X!      * cannot make these available, even more so because we use the user's
  685. X!      * preferred Workbench colors. Instead, we use different combinations
  686. X!      * of the 4 possible colors. For orientation: default colors are
  687. X!      * white (1) on blue (0), and a orange (3) cursor on a black (2) character.
  688. X!      *
  689. X!      * "Black": Black on White
  690. X!      * "Red":    Orange on Black
  691. X!      * "Green": White on Black
  692. X!      * "Yellow": Orange on Blue
  693. X!      * "Blue":    Orange on White
  694. X!      * "Magenta": White on Black
  695. X!      * "Cyan":    White on Black
  696. X!      * "White": Blue on White
  697. X       */
  698. X!     for (c = 0; c < SIZE(HI_COLOR); c++) {
  699. X!     HI_COLOR[c] = (char *) alloc(sizeof("E0;33;44m"));
  700. X!     Sprintf(HI_COLOR[c], "\2333%d;4%dm", foreg[c], backg[c]);
  701. X      }
  702. X  
  703. X      HI = "\2331m";              /* Bold (hilight) */
  704. X--- 52,76 ----
  705. X  {
  706. X  #ifdef TEXTCOLOR
  707. X      register int c;
  708. X! #endif
  709. X      (void) Initialize();        /* This opens screen, window, console, &c */
  710. X      CO = COLNO;
  711. X      LI = ROWNO+3;               /* used in pri.c and pager.c */
  712. X  
  713. X      set_whole_screen();
  714. X      CD = "\233J";               /* used in pager.c */
  715. X  
  716. X  #ifdef TEXTCOLOR
  717. X      /*
  718. X!      * Perform amiga to color.h colormap conversion - Please note that the
  719. X!      * console device can only handle 8 foreground and 8 background colors
  720. X!      * while color.h defines 8 basic and 8 hilite colors.  Hilite colors
  721. X!      * are handled as inverses.  For instance, a hilited green color will
  722. X!      * appear as green background with a black foreground.
  723. X       */
  724. X!     for (c = 0; c < SIZE(hilites); c++) {
  725. X!         hilites[c] = (char *) alloc(sizeof("E0;33;44m"));
  726. X!         Sprintf(hilites[c], "\2333%d;4%dm", foreg[c], backg[c]);
  727. X      }
  728. X  
  729. X      HI = "\2331m";              /* Bold (hilight) */
  730. X*** amiga/Old/amitty.c    Mon Feb 19 16:52:15 1990
  731. X--- amiga/amitty.c    Sun Feb 18 16:32:01 1990
  732. X***************
  733. X*** 46,53 ****
  734. X      VA_INIT(s, char *);
  735. X      end_screen();
  736. X      putchar('\n');
  737. X!     vprintf(s,VA_ARGS);
  738. X      putchar('\n');
  739. X      VA_END();
  740. X!     abort(1);
  741. X  }
  742. X--- 46,57 ----
  743. X      VA_INIT(s, char *);
  744. X      end_screen();
  745. X      putchar('\n');
  746. X! 
  747. X!         {char buf[180];
  748. X!     vsprintf(buf,s,VA_ARGS);
  749. X!         printf(buf);
  750. X!         }    /* Overloaded */
  751. X      putchar('\n');
  752. X      VA_END();
  753. X!     Abort(0L);
  754. X  }
  755. X*** amiga/Old/amiunix.c    Mon Feb 19 16:52:27 1990
  756. X--- amiga/amiunix.c    Thu Dec 28 17:27:19 1989
  757. X***************
  758. X*** 26,31 ****
  759. X--- 26,33 ----
  760. X  
  761. X  extern time_t time();
  762. X  
  763. X+ static struct tm *NDECL(getlt);
  764. X+ 
  765. X  void
  766. X  setrandom()
  767. X  {
  768. X*** /dev/null    Mon Feb 19 16:52:37 1990
  769. X--- amiga/amiwbench.c    Fri Feb 16 19:05:02 1990
  770. X***************
  771. X*** 0 ****
  772. X--- 1,534 ----
  773. X+ /*    SCCS Id: @(#)amiwbench.c - Amiga Workbench interface  3.0   */
  774. X+ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1990      */
  775. X+ /* NetHack may be freely redistributed.  See license for details. */
  776. X+ 
  777. X+ #include "hack.h"
  778. X+ 
  779. X+ #undef TRUE
  780. X+ #undef FALSE
  781. X+ #undef COUNT
  782. X+ #undef NULL
  783. X+ 
  784. X+ #ifdef LATTICE
  785. X+ #include <proto/exec.h>
  786. X+ #include <proto/dos.h>
  787. X+ #include <proto/icon.h>
  788. X+ #endif
  789. X+ 
  790. X+ #include <workbench/startup.h>
  791. X+ #include <workbench/workbench.h>
  792. X+ #include <exec/memory.h>
  793. X+ #include <ctype.h>
  794. X+ 
  795. X+ #ifdef LATTICE
  796. X+ #include <string.h>
  797. X+ #undef strlen            /* grrr */
  798. X+ #endif
  799. X+ 
  800. X+ #define ALLOC_SIZE        ((long)sizeof(struct FileInfoBlock))
  801. X+ 
  802. X+ #ifdef AZTEC_C
  803. X+ /*
  804. X+  * Change when manx becomes ANSI complient
  805. X+  */
  806. X+ BPTR FDECL(CurrentDir,(BPTR));
  807. X+ BPTR FDECL(ParentDir, (BPTR));
  808. X+ BPTR FDECL(Lock, (char *, long));
  809. X+ void *FDECL(AllocMem, (long, long));
  810. X+ void FDECL(FreeMem, (void *, long));
  811. X+ unsigned short FDECL(Examine, (BPTR, struct FileInfoBlock *));
  812. X+ struct Library *FDECL(OpenLibrary,(char *, long));
  813. X+ struct DiskObject *FDECL(GetDiskObject, (char *));
  814. X+ 
  815. X+ extern struct Library *IconBase;
  816. X+ #endif
  817. X+ 
  818. X+ #ifdef AMIGA_WBENCH
  819. X+ static void FDECL(ami_wb_findme,(char *,char *,struct WBArg *));
  820. X+ static int FDECL(buildPath,(LONG,struct FileInfoBlock *,char *));
  821. X+ static void FDECL(insert,(char *,char *));
  822. X+ 
  823. X+ BOOL FromWBench=0;        /* if FALSE, this file is a big NOP */
  824. X+ static BOOL FromTool=0;        /* or from Project (ergo nothing to restore) */
  825. X+ static char argline[80];    /* fake command line from ToolTypes */
  826. X+ static BOOL TTparse=0;        /* parsing tooltypes? */
  827. X+ static BOOL KillIcon=FALSE;    /* delayed expunge of user's icon */
  828. X+ static char iconname[PATHLEN+5];
  829. X+ static char origicon[PATHLEN+5];
  830. X+ static char savefname[PL_NSIZ];        /* name from name of save file */
  831. X+ 
  832. X+ extern const char *classes;    /* liberated from pcmain */
  833. X+ extern char *PATH;
  834. X+ 
  835. X+ /* Called after NetHack.cnf (and maybe NETHACKOPTIONS) are read.
  836. X+  * If this is a request to show the score file, do it here and quit.
  837. X+  */
  838. X+ void ami_wbench_init(argc,argv)
  839. X+ int argc;
  840. X+ char *argv[];
  841. X+ {
  842. X+     struct WBStartup *wbs=(struct WBStartup *)argv;
  843. X+     struct WBArg *wa;
  844. X+     int    ia;            /* arg of active icon */
  845. X+     int    x,doscore=0;
  846. X+     char     *p,*lp;
  847. X+     BPTR    olddir;            /* starting directory */
  848. X+     struct DiskObject *dobj;
  849. X+     char    *scorearg;
  850. X+     char    tmp_ramdisk[PATHLEN];
  851. X+     char    tmp_levels[PATHLEN];
  852. X+ 
  853. X+     FromWBench=(argc==0);
  854. X+     if(!FromWBench)return;            /* nothing if from CLI */
  855. X+ 
  856. X+     /*
  857. X+      * "NULL" out arrays
  858. X+      */
  859. X+     tmp_ramdisk[0] = '\0';
  860. X+     tmp_levels[0]  = '\0';
  861. X+ 
  862. X+     IconBase=OpenLibrary("icon.library",33L);
  863. X+     if(!IconBase)error("icon.library missing!");
  864. X+ 
  865. X+     wa=wbs->sm_ArgList;
  866. X+     if(wbs->sm_NumArgs>2)error("You can only play one game at a time!");
  867. X+     ia=wbs->sm_NumArgs-1;
  868. X+     strcpy(savefname,wa[ia].wa_Name);
  869. X+     if(!strncmp(index(savefname,'.'),".sav",4)){
  870. X+         *index(savefname,'.')='\0';
  871. X+     } else {
  872. X+         savefname[0]='\0';    /* don't override if not save file */
  873. X+     }
  874. X+ 
  875. X+     olddir=CurrentDir(wa[ia].wa_Lock);   /* where the icon is */
  876. X+ 
  877. X+     dobj=GetDiskObject(wa[ia].wa_Name);
  878. X+     (void)CurrentDir(olddir);        /* and back */
  879. X+     if(!dobj){
  880. X+         error("Sorry, I can't find your icon!");
  881. X+     }
  882. X+ 
  883. X+     FromTool=(dobj->do_Type==WBTOOL)?1:
  884. X+             (dobj->do_Type==WBPROJECT)?0:
  885. X+             (error("Sorry, I don't recognize this icon type!"),1);
  886. X+ 
  887. X+     ami_wb_findme(SAVEF,SAVEP,&wa[ia]);
  888. X+     strcpy(origicon,SAVEF);
  889. X+     strcat(origicon,".info");
  890. X+ 
  891. X+     argline[0]='\0';
  892. X+     for(x=0;p=dobj->do_ToolTypes[x];x++){
  893. X+         lp=index(p,'=');
  894. X+         if(!lp++){
  895. X+             if((strncmp(p,"SCORES",6)==0) ||
  896. X+                (strncmp(p,"SCORE",5)==0)){
  897. X+                 doscore=1;
  898. X+                 scorearg=malloc(strlen(p)+1);
  899. X+                 strcpy(scorearg,p);
  900. X+             } else {
  901. X+                 TTparse=TRUE;
  902. X+                 parseoptions(p,(boolean)TRUE);
  903. X+                 TTparse=FALSE;
  904. X+             }
  905. X+         } else {
  906. X+             while(*lp && isspace(*lp))lp++;
  907. X+                 /* vars and lengths below match amidos.c,
  908. X+                  * but there is no SAVE - you put the
  909. X+                  * icon where you want it, and GRAPHICS
  910. X+                  * just doesn't belong        */
  911. X+             if(!strncmp(p,"OPTIONS",4)){
  912. X+                 TTparse=TRUE;
  913. X+                 parseoptions(lp,(boolean)TRUE);
  914. X+                 TTparse=FALSE;
  915. X+             } else
  916. X+             if(lp[0]=='#'){
  917. X+                 /* for perversity's sake, a comment */
  918. X+             } else
  919. X+             if(!strncmp(p,"HACKDIR",4)){
  920. X+                 strncpy(hackdir,lp,PATHLEN);
  921. X+             } else
  922. X+             if(!strncmp(p,"RAMDISK",3)){
  923. X+                 strncpy(tmp_ramdisk,lp,PATHLEN);
  924. X+             } else
  925. X+             if(!strncmp(p,"LEVELS",4)){
  926. X+                 strncpy(tmp_levels,lp,PATHLEN);
  927. X+             } else
  928. X+             if(!strncmp(p,"PATH",4)){
  929. X+                 strncpy(PATH,lp,PATHLEN);
  930. X+             } else
  931. X+                 /* new things */
  932. X+             if((strncmp(p,"CMDLINE",7)==0)||
  933. X+                (strncmp(p,"COMMANDLINE",11)==0)){
  934. X+                 strncpy(argline,lp,79);
  935. X+             } else
  936. X+             {
  937. X+                 msmsg("Bad ToolTypes line: '%s'\n",p);
  938. X+                 getreturn("to continue");
  939. X+             }
  940. X+         }
  941. X+     }
  942. X+         /* cleanup - from amidos.c, except we only change things
  943. X+          * that are explicitly changed, since we already
  944. X+          * did this once to get the defaults (in amidos.c)    */
  945. X+     if(plname[0])plnamesuffix();    /* from amidos.c */
  946. X+     if(tmp_levels[0])strcpy(permbones,tmp_levels);
  947. X+     if(tmp_ramdisk[0]){
  948. X+         strcpy(levels,tmp_ramdisk);
  949. X+         strcpy(bones,levels);
  950. X+         if(strcmp(permbones,levels))
  951. X+             ramdisk=TRUE;
  952. X+     } else {
  953. X+         if(tmp_levels[0]){
  954. X+             strcpy(levels,tmp_levels);
  955. X+             strcpy(bones,levels);
  956. X+         }
  957. X+     }
  958. X+ 
  959. X+     FreeDiskObject(dobj);    /* we'll get it again later if we need it */
  960. X+ 
  961. X+     if(doscore){
  962. X+         long ac;
  963. X+         char *p;
  964. X+         char **av=calloc(1,50*sizeof(char *));
  965. X+ #ifdef CHDIR
  966. X+         chdirx(hackdir,0);
  967. X+ #endif
  968. X+         av[0]="NetHack";            /* why not? */
  969. X+         for(ac=1,p=scorearg;*p;ac++){
  970. X+             av[ac]=p;
  971. X+             while(*p && !isspace(*p))p++;
  972. X+             if(!*p)break;
  973. X+             *p++='\0';
  974. X+             while(*p && isspace(*p))p++;
  975. X+             if(ac==1)sprintf(av[ac],"-s");    /* overwrite SCORES */
  976. X+         }
  977. X+         prscore(ac+1,av);
  978. X+         exit(0);        /* overloaded */
  979. X+     }
  980. X+ 
  981. X+             /* if the user started us from the tool icon,
  982. X+              * we can't save the game in the same place
  983. X+              * we started from, so pick up the plname
  984. X+              * and hope for the best.
  985. X+              */
  986. X+     if(FromTool){
  987. X+         strcat(SAVEF,plname);
  988. X+         strcat(SAVEP,plname);
  989. X+     }
  990. X+ }
  991. X+ 
  992. X+ /* Simulate the command line (-s is already done, although this is
  993. X+  * not exactly the way it should be). Note that we only handle flags
  994. X+  * that are not otherwise available in NetHack.cnf        */
  995. X+ void ami_wbench_args(){
  996. X+     char *p=argline;
  997. X+     if(!FromWBench)return;
  998. X+     if(!argline)return;
  999. X+ 
  1000. X+     while(*p){
  1001. X+         switch(*p++){
  1002. X+         case '-':    break;
  1003. X+ #ifdef NEWS
  1004. X+         case 'n':    flags.nonews = TRUE;
  1005. X+ #endif
  1006. X+ #if defined(WIZARD) || defined(EXPLORE_MODE)
  1007. X+ # ifndef EXPLORE_MODE
  1008. X+         case 'X':
  1009. X+ # endif
  1010. X+         case 'D':
  1011. X+ # ifdef WIZARD
  1012. X+ #  ifdef KR1ED
  1013. X+             if(!strcmp(plname,WIZARD_NAME)){
  1014. X+ #  else
  1015. X+             if(!strcmp(plname,WIZARD)){
  1016. X+ #  endif
  1017. X+                 wizard=TRUE;break;
  1018. X+             }
  1019. X+             /* else fall through */
  1020. X+ # endif
  1021. X+ # ifdef EXPLORE_MODE
  1022. X+         case 'X':    discover=TRUE;
  1023. X+ # endif
  1024. X+                 break;
  1025. X+ #endif
  1026. X+ #ifdef DGK
  1027. X+         case 'r':    /* no ram disk */
  1028. X+             ramdisk=FALSE;
  1029. X+             break;
  1030. X+ #endif
  1031. X+         default:
  1032. X+             p--;
  1033. X+             if(index(classes,toupper(*p))){
  1034. X+                 char *t=pl_character;
  1035. X+                 int cnt=sizeof(pl_character)-1;
  1036. X+                 while(cnt && *p && !isspace(*p))*t++=*p++,cnt--;
  1037. X+                 *t=0;
  1038. X+             } else {
  1039. X+                 Printf("Unknown switch: %s\n",p);
  1040. X+                 return;
  1041. X+             }
  1042. X+         }
  1043. X+     }
  1044. X+ }
  1045. X+ 
  1046. X+ 
  1047. X+ /* IF (from workbench) && (currently parsing ToolTypes)
  1048. X+  * THEN print error message and return 0
  1049. X+  * ELSE return 1
  1050. X+  */
  1051. X+ ami_wbench_badopt(oopsline)
  1052. X+ char *oopsline;
  1053. X+ {
  1054. X+     if(!FromWBench)return 1;
  1055. X+     if(!TTparse)return 1;
  1056. X+     Printf("Bad Syntax in OPTIONS in ToolTypes: %s.",oopsline);
  1057. X+     return 0;
  1058. X+ }
  1059. X+ 
  1060. X+ /* Construct (if necessary) and fill in icon for given save file */
  1061. X+ void ami_wbench_iconwrite(base)
  1062. X+ char *base;
  1063. X+ {
  1064. X+     BPTR lock;
  1065. X+     char tmp[PATHLEN+5];
  1066. X+ 
  1067. X+     if(!FromWBench)return;
  1068. X+ 
  1069. X+     strcpy(tmp,base);
  1070. X+     strcat(tmp,".info");
  1071. X+     if(FromTool){                /* user clicked on main icon */
  1072. X+         (void)CopyFile(DEFAULT_ICON,tmp);
  1073. X+     } else {                /* from project */
  1074. X+         lock=Lock(tmp,ACCESS_READ);
  1075. X+         if(lock==0){    /* maybe our name changed - try to get
  1076. X+                  * original icon */
  1077. X+             if(!Rename(origicon,tmp)){
  1078. X+                 /* nope, build a new icon */
  1079. X+             lock=Lock(DEFAULT_ICON,ACCESS_READ);
  1080. X+             if(lock==0)return;        /* no icon today */
  1081. X+             UnLock(lock);
  1082. X+             (void)CopyFile(DEFAULT_ICON,tmp);
  1083. X+             }
  1084. X+         } else UnLock(lock);
  1085. X+     }
  1086. X+     KillIcon=FALSE;
  1087. X+ 
  1088. X+ /*    dobj=GetDiskObject(base);
  1089. X+     anything we need to change?  I don't think so.
  1090. X+     PutDiskObject(base,dobj);
  1091. X+     FreeDiskObject(dobj);
  1092. X+ */
  1093. X+ }
  1094. X+ 
  1095. X+ /* How much disk space will we need for the icon? */
  1096. X+ int ami_wbench_iconsize(base)
  1097. X+ char *base;
  1098. X+ {
  1099. X+     struct FileInfoBlock *fib;
  1100. X+     BPTR lock;
  1101. X+     int    rv;
  1102. X+     char tmp[PATHLEN+5];
  1103. X+ 
  1104. X+     if(!FromWBench)return(0);
  1105. X+     strcpy(tmp,base);
  1106. X+     strcat(tmp,".info");
  1107. X+     lock=Lock(tmp,ACCESS_READ);
  1108. X+     if(lock==0){    /* check the default */
  1109. X+         lock=Lock(DEFAULT_ICON,ACCESS_READ);
  1110. X+         if(lock==0)return(0);
  1111. X+     }
  1112. X+     fib = (struct FileInfoBlock *)AllocMem(ALLOC_SIZE, MEMF_CLEAR);
  1113. X+     if(!Examine(lock,fib)){
  1114. X+         UnLock(lock);
  1115. X+         FreeMem(fib, ALLOC_SIZE);
  1116. X+         return(0);            /* if no icon, there
  1117. X+                          * never will be one */
  1118. X+     }
  1119. X+     rv=fib->fib_Size+strlen(plname);    /* guessing */
  1120. X+     UnLock(lock);
  1121. X+     FreeMem(fib, ALLOC_SIZE);
  1122. X+     return(rv);
  1123. X+ }
  1124. X+ 
  1125. X+ /* Delete the icon associated with the given file (NOT the file itself! */
  1126. X+ /* (Don't worry if the icon doesn't exist */
  1127. X+ void ami_wbench_unlink(base)
  1128. X+ char *base;
  1129. X+ {
  1130. X+     if(!FromWBench)return;
  1131. X+ 
  1132. X+     strcpy(iconname,base);
  1133. X+     strcat(iconname,".info");
  1134. X+     KillIcon=TRUE;            /* don't do it now - this way the user
  1135. X+                      * gets back whatever picture we had
  1136. X+                      * when we started if the game is
  1137. X+                      * saved again             */
  1138. X+ /*    unlink(tmp); */
  1139. X+ }
  1140. X+ 
  1141. X+ /* Check for a saved game.
  1142. X+ IF not a saved game -> -1
  1143. X+ IF can't open SAVEF -> -1
  1144. X+ ELSE -> fd for reading SAVEF */
  1145. X+ int ami_wbench_getsave(mode)
  1146. X+ int mode;
  1147. X+ {
  1148. X+     BPTR lock;
  1149. X+     struct FileInfoBlock *fib;
  1150. X+ 
  1151. X+     if(!FromWBench)return(open(SAVEF,mode));
  1152. X+             /* if the file will be created anyway, skip the
  1153. X+              * checks and just do it            */
  1154. X+     if(mode & O_CREAT)return(open(SAVEF,mode));
  1155. X+     if(FromTool)return(-1);        /* otherwise, by definition, there
  1156. X+                      * isn't a save file (even if a
  1157. X+                      * file of the right name exists) */
  1158. X+     if(savefname[0])
  1159. X+         strncpy(plname,savefname,PL_NSIZ-1); /* restore poly'd name */
  1160. X+     lock=Lock(SAVEF,ACCESS_READ);
  1161. X+     fib = (struct FileInfoBlock *)AllocMem(ALLOC_SIZE, MEMF_CLEAR);
  1162. X+     if(lock && Examine(lock,fib)){
  1163. X+         if(fib->fib_Size>100){    /* random number << save file size */
  1164. X+             UnLock(lock);
  1165. X+                         FreeMem(fib,ALLOC_SIZE);
  1166. X+             return(open(SAVEF,mode));
  1167. X+         } else {
  1168. X+                 /* this is a dummy file we need because
  1169. X+                  * workbench won't duplicate an icon with no
  1170. X+                  * "real" data attached - try to get rid of it.
  1171. X+                  */
  1172. X+             UnLock(lock);
  1173. X+             unlink(SAVEF);
  1174. X+             FreeMem(fib,ALLOC_SIZE);
  1175. X+             return(-1);
  1176. X+         }
  1177. X+     }
  1178. X+     FreeMem(fib,ALLOC_SIZE);
  1179. X+     return(-1);        /* give up */
  1180. X+ }
  1181. X+ 
  1182. X+ #ifdef notdef
  1183. X+ /* cleanup */
  1184. X+ void ami_wbench_cleanup(){
  1185. X+     if(!FromWBench)return;
  1186. X+     if(KillIcon){
  1187. X+         unlink(iconname);
  1188. X+     } else {
  1189. X+         if(!FromTool){    /* game started and ended in one session */
  1190. X+             char buf[PATHLEN+5];
  1191. X+             strcpy(buf,SAVEF);
  1192. X+             strcat(buf,".info");
  1193. X+             unlink(buf);
  1194. X+         }
  1195. X+     }
  1196. X+ }
  1197. X+ #endif
  1198. X+ 
  1199. X+ /* get printable version of where we came from */
  1200. X+ static void ami_wb_findme(bufp,dirp,wa)
  1201. X+     char *bufp,*dirp;
  1202. X+     struct WBArg *wa;
  1203. X+     {
  1204. X+     BPTR dir;
  1205. X+     struct FileInfoBlock *fib;
  1206. X+     char *p;
  1207. X+     int len;
  1208. X+ 
  1209. X+     dir=wa->wa_Lock;
  1210. X+ 
  1211. X+     fib = (struct FileInfoBlock *)AllocMem(ALLOC_SIZE,MEMF_CLEAR);
  1212. X+     buildPath(dir,fib,dirp);
  1213. X+     strcat(dirp,"/");
  1214. X+     strcpy(bufp,dirp);
  1215. X+     if(FromTool){
  1216. X+         /* do nothing - filename will be added later */
  1217. X+     } else {
  1218. X+         strcat(bufp,wa->wa_Name);
  1219. X+     };
  1220. X+     /* I know this looks redundent, but its not since we may add
  1221. X+      * a slash after returning from buildPath
  1222. X+      */
  1223. X+     p=index(bufp,':');
  1224. X+     if(!p){
  1225. X+         p=index(bufp,'/');
  1226. X+         if(p)*p=':';
  1227. X+     }
  1228. X+     p=index(dirp,':');
  1229. X+     if(!p){
  1230. X+         p=index(dirp,'/');
  1231. X+         if(p)*p=':';
  1232. X+     }
  1233. X+     /* We found the icon - but we need the main file. */
  1234. X+     len=strlen(bufp);
  1235. X+     if(len<5)return;            /* who knows? */
  1236. X+     if(strcmp(".info",&bufp[len-5]))return; /* who knows? */
  1237. X+     bufp[len-5]='\0';
  1238. X+         FreeMem(fib, ALLOC_SIZE);
  1239. X+ }
  1240. X+ 
  1241. X+ /* Carolyn Scheppner - CATS, AmigaMail II-34 */
  1242. X+ static int
  1243. X+ buildPath(inlock,fib,buf)
  1244. X+ LONG inlock;
  1245. X+ struct FileInfoBlock *fib;           /* ASSUMED LONGWORD BOUNDARY!! */
  1246. X+ char *buf;
  1247. X+     {
  1248. X+     int i;
  1249. X+     LONG lock,oldlock;
  1250. X+     BOOL MyOldLock = FALSE;
  1251. X+ 
  1252. X+     buf[0]='\0';
  1253. X+     lock=inlock;
  1254. X+ 
  1255. X+     while(lock){
  1256. X+         if(Examine(lock,fib)){
  1257. X+             if(fib->fib_FileName[0]>' '){
  1258. X+                 if(buf[0])insert(buf,"/");
  1259. X+                 insert(buf,fib->fib_FileName);
  1260. X+             }
  1261. X+         }
  1262. X+         oldlock=lock;
  1263. X+         lock=ParentDir(lock);
  1264. X+         if(MyOldLock) UnLock(oldlock);
  1265. X+         else MyOldLock=TRUE;
  1266. X+     }
  1267. X+     if(fib->fib_FileName[0]>' '){
  1268. X+         for(i=0;i<(strlen(buf));i++){
  1269. X+             if(buf[i]=='/'){
  1270. X+                 buf[i]=':';
  1271. X+                 break;
  1272. X+             }
  1273. X+         }
  1274. X+     }
  1275. X+     else insert(buf,"RAM:");
  1276. X+     return((int)strlen(buf));
  1277. X+ }
  1278. X+ static void
  1279. X+ insert(buf,s)
  1280. X+ char *buf,*s;
  1281. X+ {
  1282. X+     char tmp[256];
  1283. X+     strcpy(tmp,buf);
  1284. X+     strcpy(buf,s);
  1285. X+     strcpy(&buf[strlen(s)],tmp);
  1286. X+ }
  1287. X+ 
  1288. X+ #if 0 /* CopyFile should be OK */
  1289. X+ static void copyicon(from,to)
  1290. X+ char *from,*to;
  1291. X+ {
  1292. X+     int df,dt;
  1293. X+     char buf[512];
  1294. X+     int len=512;
  1295. X+ 
  1296. X+     df=open(from,O_RDONLY);
  1297. X+     dt=open(to,O_WRONLY,0);
  1298. X+     while(len=512){
  1299. X+         len=read(df,buf,len);
  1300. X+         write(dt,buf,len);
  1301. X+     }
  1302. X+     close(df);
  1303. X+     close(dt);
  1304. X+ }
  1305. X+ #endif
  1306. X+ #endif /* AMIGA_WBENCH */
  1307. X*** amiga/Old/amiwind.c    Mon Feb 19 16:52:53 1990
  1308. X--- amiga/amiwind.c    Thu Feb 15 19:05:25 1990
  1309. X***************
  1310. X*** 8,14 ****
  1311. X   *  screens, windows, menus, and input via IntuiMessages.
  1312. X   */
  1313. X  
  1314. X! #define MANX            /* Define for the Manx compiler */
  1315. X  
  1316. X  #include <exec/types.h>
  1317. X  #include <exec/alerts.h>
  1318. X--- 8,19 ----
  1319. X   *  screens, windows, menus, and input via IntuiMessages.
  1320. X   */
  1321. X  
  1322. X! #include "hack.h"
  1323. X! 
  1324. X! #undef TRUE
  1325. X! #undef FALSE
  1326. X! #undef COUNT
  1327. X! #undef NULL
  1328. X  
  1329. X  #include <exec/types.h>
  1330. X  #include <exec/alerts.h>
  1331. X***************
  1332. X*** 19,46 ****
  1333. X  #include <intuition/intuition.h>
  1334. X  #include <libraries/dosextens.h>
  1335. X  
  1336. X! #undef TRUE            /* All these are also defined in */
  1337. X! #undef FALSE            /* the Amiga system include files */
  1338. X! #undef COUNT
  1339. X! #undef NULL
  1340. X! 
  1341. X! #include "hack.h"
  1342. X! 
  1343. X! #include "amimenu.c"
  1344. X  
  1345. X  /*  First, external declarations... */
  1346. X  
  1347. X- struct Library *OpenLibrary();
  1348. X- struct Screen *OpenScreen();
  1349. X- struct Window *OpenWindow();
  1350. X- struct TextFont *OpenDiskFont(), *OpenFont();
  1351. X- struct IntuiMessage *GetMsg();
  1352. X- struct MenuItem *ItemAddress();
  1353. X- struct Process *FindTask();         /* Cheating */
  1354. X- long DeadKeyConvert(), OpenDevice(), CloseDevice();
  1355. X- struct MsgPort *CreatePort();
  1356. X  extern struct Library *IconBase;
  1357. X! void abort();
  1358. X  
  1359. X  /*  Now our own variables */
  1360. X  
  1361. X--- 24,88 ----
  1362. X  #include <intuition/intuition.h>
  1363. X  #include <libraries/dosextens.h>
  1364. X  
  1365. X! #ifdef LATTICE
  1366. X! #include <dos.h>
  1367. X! #include <proto/exec.h>
  1368. X! #include <proto/graphics.h>
  1369. X! #include <proto/intuition.h>
  1370. X! #include <proto/diskfont.h>
  1371. X! #include <proto/console.h>
  1372. X! #endif
  1373. X! 
  1374. X! #include "Amiga:amimenu.c"
  1375. X! 
  1376. X! /*
  1377. X!  * Versions we need of various libraries.  We can't use LIBRARY_VERSION
  1378. X!  * as defined in <exec/types.h> because some of the libraries we need
  1379. X!  * don't have that version number in the 1.2 ROM.
  1380. X!  */
  1381. X! 
  1382. X! #define INTUITION_VERSION 33L
  1383. X! #define GRAPHICS_VERSION  33L
  1384. X! #define DISKFONT_VERSION  34L
  1385. X! #define ICON_VERSION      34L
  1386. X  
  1387. X  /*  First, external declarations... */
  1388. X  
  1389. X  extern struct Library *IconBase;
  1390. X! struct Library *ConsoleDevice;
  1391. X! 
  1392. X! #ifdef AZTEC_C
  1393. X! void FDECL(Alert, (long, char *));
  1394. X! void NDECL(Forbid);
  1395. X! void NDECL(Permit);
  1396. X! struct Process *FDECL(FindTask, (char *));
  1397. X! struct Library *FDECL(OpenLibrary, (char *, long));
  1398. X! void FDECL(CloseLibrary, (struct Library *));
  1399. X! struct Message *FDECL(GetMsg, (struct MsgPort *));
  1400. X! void FDECL(ReplyMsg, (struct Message *));
  1401. X! long FDECL(OpenDevice, (char *, long, struct IORequest *, long));
  1402. X! void FDECL(CloseDevice, (struct IORequest *));
  1403. X! long FDECL(DoIO, (struct IORequest *));
  1404. X! struct TextFont *FDECL(OpenDiskFont, (struct TextAttr *));
  1405. X! struct TextFont *FDECL(OpenFont, (struct TextAttr *));
  1406. X! void FDECL(CloseFont, (struct TextFont *));
  1407. X! void FDECL(LoadRGB4, (struct ViewPort *, unsigned short *, long));
  1408. X! long FDECL(SetFont, (struct RastPort *, struct TextFont*));
  1409. X! struct MsgPort *FDECL(CreatePort, (char *, long));
  1410. X! void FDECL(DeletePort, (struct MsgPort *));
  1411. X! struct Screen *FDECL(OpenScreen, (struct NewScreen *));
  1412. X! struct Window *FDECL(OpenWindow, (struct NewWindow *));
  1413. X! void FDECL(CloseWindow, (struct Window *));
  1414. X! void FDECL(SetMenuStrip, (struct Window *, struct Menu *));
  1415. X! void FDECL(ClearMenuStrip, (struct Window *));
  1416. X! struct MenuItem *FDECL(ItemAddress, (struct Menu *, long));
  1417. X! long FDECL(RawKeyConvert, (struct InputEvent *, char *, long, struct KeyMap *));
  1418. X! #endif
  1419. X! 
  1420. X! static int NDECL(BufferGetchar);
  1421. X! static void FDECL(ConvertKey, (register struct IntuiMessage *));
  1422. X! static void FDECL(ProcessMessage, (register struct IntuiMessage *));
  1423. X! void NDECL(Initialize);
  1424. X  
  1425. X  /*  Now our own variables */
  1426. X  
  1427. X***************
  1428. X*** 56,62 ****
  1429. X  struct Library *DiskfontBase;
  1430. X  #endif
  1431. X  
  1432. X! struct Device *ConsoleDevice;
  1433. X  
  1434. X  #define CSI        '\x9b'
  1435. X  #define NO_CHAR     -1
  1436. X--- 98,104 ----
  1437. X  struct Library *DiskfontBase;
  1438. X  #endif
  1439. X  
  1440. X! extern struct Library *ConsoleDevice;
  1441. X  
  1442. X  #define CSI        '\x9b'
  1443. X  #define NO_CHAR     -1
  1444. X***************
  1445. X*** 103,109 ****
  1446. X--- 145,166 ----
  1447. X  #define BARHEIGHT    11
  1448. X  #define WINDOWHEIGHT    192
  1449. X  #define WIDTH        640
  1450. X+ 
  1451. X+ #ifdef TEXTCOLOR
  1452. X+ #define DEPTH       3
  1453. X+ static unsigned short palette[] = {
  1454. X+     0x0000,    /* Black   */
  1455. X+     0x0DDD, /* White   */
  1456. X+         0x0C75, /* Brown   */
  1457. X+     0x0B08,    /* Cyan    */
  1458. X+     0x00B0,    /* Green   */
  1459. X+     0x0F08,    /* Magenta */
  1460. X+     0x055F,    /* Blue    */
  1461. X+     0x0F00,    /* Red     */
  1462. X+ };
  1463. X+ #else
  1464. X  #define DEPTH        2
  1465. X+ #endif
  1466. X  
  1467. X  struct NewScreen NewHackScreen = {
  1468. X      0, 0, WIDTH, BARHEIGHT + WINDOWHEIGHT, DEPTH,
  1469. X***************
  1470. X*** 161,167 ****
  1471. X   *  RawKeyConvert those events???
  1472. X   */
  1473. X  
  1474. X! int ConvertKey(message)
  1475. X  register struct IntuiMessage *message;
  1476. X  {
  1477. X      static struct InputEvent theEvent;
  1478. X--- 218,224 ----
  1479. X   *  RawKeyConvert those events???
  1480. X   */
  1481. X  
  1482. X! static void ConvertKey(message)
  1483. X  register struct IntuiMessage *message;
  1484. X  {
  1485. X      static struct InputEvent theEvent;
  1486. X***************
  1487. X*** 210,216 ****
  1488. X  
  1489. X  #ifdef BETA
  1490. X      if (!ConsoleDevice) { /* Should never happen */
  1491. X!     abort(AG_IOError | AO_ConsoleDev);
  1492. X      return;
  1493. X      }
  1494. X  #endif
  1495. X--- 267,273 ----
  1496. X  
  1497. X  #ifdef BETA
  1498. X      if (!ConsoleDevice) { /* Should never happen */
  1499. X!     Abort(AG_IOError | AO_ConsoleDev);
  1500. X      return;
  1501. X      }
  1502. X  #endif
  1503. X***************
  1504. X*** 251,257 ****
  1505. X   *  ahead of input demands, when the user types ahead.
  1506. X   */
  1507. X  
  1508. X! static char ProcessMessage(message)
  1509. X  register struct IntuiMessage *message;
  1510. X  {
  1511. X      switch(message->Class) {
  1512. X--- 308,314 ----
  1513. X   *  ahead of input demands, when the user types ahead.
  1514. X   */
  1515. X  
  1516. X! static void ProcessMessage(message)
  1517. X  register struct IntuiMessage *message;
  1518. X  {
  1519. X      switch(message->Class) {
  1520. X***************
  1521. X*** 262,268 ****
  1522. X  
  1523. X          thismenu = message->Code;
  1524. X          while (thismenu != MENUNULL) {
  1525. X!         item = ItemAddress(&HackMenu, (ULONG) thismenu);
  1526. X          if (KbdBuffered < KBDBUFFER)
  1527. X              BufferQueueChar(item->Command); /* Unused: No COMMSEQ */
  1528. X          thismenu = item->NextSelect;
  1529. X--- 319,325 ----
  1530. X  
  1531. X          thismenu = message->Code;
  1532. X          while (thismenu != MENUNULL) {
  1533. X!         item = ItemAddress(HackMenu, (ULONG) thismenu);
  1534. X          if (KbdBuffered < KBDBUFFER)
  1535. X              BufferQueueChar(item->Command); /* Unused: No COMMSEQ */
  1536. X          thismenu = item->NextSelect;
  1537. X***************
  1538. X*** 283,289 ****
  1539. X      }
  1540. X  #endif
  1541. X      }
  1542. X!     ReplyMsg(message);
  1543. X  }
  1544. X  
  1545. X  /*
  1546. X--- 340,346 ----
  1547. X      }
  1548. X  #endif
  1549. X      }
  1550. X!     ReplyMsg((struct Message *) message);
  1551. X  }
  1552. X  
  1553. X  /*
  1554. X***************
  1555. X*** 299,308 ****
  1556. X      register struct IntuiMessage *message;
  1557. X  
  1558. X      while( (KbdBuffered < KBDBUFFER / 2) &&
  1559. X!         (message = GetMsg(HackWindow->UserPort)) )
  1560. X      ProcessMessage(message);
  1561. X  
  1562. X!     return KbdBuffered;
  1563. X  }
  1564. X  
  1565. X  /*
  1566. X--- 356,365 ----
  1567. X      register struct IntuiMessage *message;
  1568. X  
  1569. X      while( (KbdBuffered < KBDBUFFER / 2) &&
  1570. X!         (message = (struct IntuiMessage *) GetMsg(HackWindow->UserPort)) )
  1571. X      ProcessMessage(message);
  1572. X  
  1573. X!     return (int) KbdBuffered;
  1574. X  }
  1575. X  
  1576. X  /*
  1577. X***************
  1578. X*** 326,332 ****
  1579. X  {
  1580. X  #ifdef BETA
  1581. X      if (!ConsoleDevice) { /* Should never happen */
  1582. X!     abort(AG_IOError | AO_ConsoleDev);
  1583. X      return;
  1584. X      }
  1585. X  #endif
  1586. X--- 383,389 ----
  1587. X  {
  1588. X  #ifdef BETA
  1589. X      if (!ConsoleDevice) { /* Should never happen */
  1590. X!     Abort(AG_IOError | AO_ConsoleDev);
  1591. X      return;
  1592. X      }
  1593. X  #endif
  1594. X***************
  1595. X*** 335,341 ****
  1596. X      ConsoleIO.io_Command = CMD_WRITE;
  1597. X      ConsoleIO.io_Data = (APTR)ConsoleBuffer;
  1598. X      ConsoleIO.io_Length = Buffered;
  1599. X!     DoIO(&ConsoleIO);
  1600. X      Buffered = 0;
  1601. X      }
  1602. X  }
  1603. X--- 392,398 ----
  1604. X      ConsoleIO.io_Command = CMD_WRITE;
  1605. X      ConsoleIO.io_Data = (APTR)ConsoleBuffer;
  1606. X      ConsoleIO.io_Length = Buffered;
  1607. X!     DoIO((struct IORequest *) &ConsoleIO);
  1608. X      Buffered = 0;
  1609. X      }
  1610. X  }
  1611. X***************
  1612. X*** 362,373 ****
  1613. X  void WindowFPuts(string)
  1614. X  char *string;
  1615. X  {
  1616. X!     register int len = _BUILTIN_strlen(string);
  1617. X  
  1618. X      if (len + Buffered >= CONBUFFER)
  1619. X      WindowFlush();
  1620. X  
  1621. X!     _BUILTIN_strcpy(ConsoleBuffer + Buffered, string);
  1622. X      Buffered += len;
  1623. X  }
  1624. X  
  1625. X--- 419,430 ----
  1626. X  void WindowFPuts(string)
  1627. X  char *string;
  1628. X  {
  1629. X!     register int len = strlen(string);
  1630. X  
  1631. X      if (len + Buffered >= CONBUFFER)
  1632. X      WindowFlush();
  1633. X  
  1634. X!     strcpy(ConsoleBuffer + Buffered, string);
  1635. X      Buffered += len;
  1636. X  }
  1637. X  
  1638. X***************
  1639. X*** 389,413 ****
  1640. X   *  flushing the existing characters first, if necessary.
  1641. X   */
  1642. X  
  1643. X  void WindowPrintf(fmt, args, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
  1644. X  char *fmt;
  1645. X  long args, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9;
  1646. X  {
  1647. X! #ifdef MANX        /* Efficient but not portable */
  1648. X      format(WindowPutchar, fmt, &args);
  1649. X  #else
  1650. X      WindowFlush();  /* Don't know if all will fit */
  1651. X- # ifdef __STDC__    /* Cheap and portable way */
  1652. X-     vsprintf(ConsoleBuffer, fmt, &args);
  1653. X- # else            /* Expensive... */
  1654. X      sprintf(ConsoleBuffer, fmt, args, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
  1655. X- # endif
  1656. X      ConsoleIO.io_Command = CMD_WRITE;
  1657. X      ConsoleIO.io_Data = (APTR)ConsoleBuffer;
  1658. X      ConsoleIO.io_Length = -1;
  1659. X!     DoIO(&ConsoleIO);
  1660. X  #endif
  1661. X  }
  1662. X  
  1663. X  /*
  1664. X   *  Clean up everything. But before we do, ask the user to hit return
  1665. X--- 446,482 ----
  1666. X   *  flushing the existing characters first, if necessary.
  1667. X   */
  1668. X  
  1669. X+ /*VARARGS1*/
  1670. X+ #if defined(USE_STDARG) || defined(USE_VARARGS)
  1671. X+ void
  1672. X+ WindowPrintf VA_DECL(char *, fmt)
  1673. X+     VA_START(fmt);
  1674. X+     VA_INIT(fmt, char *);
  1675. X+     WindowFlush();  /* Don't know if all will fit */
  1676. X+     vsprintf(ConsoleBuffer, fmt, VA_ARGS);
  1677. X+     ConsoleIO.io_Command = CMD_WRITE;
  1678. X+     ConsoleIO.io_Data = (APTR)ConsoleBuffer;
  1679. X+     ConsoleIO.io_Length = -1;
  1680. X+     DoIO((struct IORequest *) &ConsoleIO);
  1681. X+     VA_END();
  1682. X+ }
  1683. X+ #else
  1684. X  void WindowPrintf(fmt, args, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
  1685. X  char *fmt;
  1686. X  long args, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9;
  1687. X  {
  1688. X! # ifdef AZTEC_C     /* Efficient but not portable */
  1689. X      format(WindowPutchar, fmt, &args);
  1690. X  #else
  1691. X      WindowFlush();  /* Don't know if all will fit */
  1692. X      sprintf(ConsoleBuffer, fmt, args, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
  1693. X      ConsoleIO.io_Command = CMD_WRITE;
  1694. X      ConsoleIO.io_Data = (APTR)ConsoleBuffer;
  1695. X      ConsoleIO.io_Length = -1;
  1696. X!     DoIO((struct IORequest *) &ConsoleIO);
  1697. X  #endif
  1698. X  }
  1699. X+ #endif
  1700. X  
  1701. X  /*
  1702. X   *  Clean up everything. But before we do, ask the user to hit return
  1703. X***************
  1704. X*** 424,430 ****
  1705. X      if (cu->cu_XCCP != 1 || cu->cu_YCCP != 1)
  1706. X          getret();
  1707. X  
  1708. X!     CloseDevice(&ConsoleIO);
  1709. X      ConsoleDevice = NULL;
  1710. X      }
  1711. X      if (ConsoleIO.io_Message.mn_ReplyPort)
  1712. X--- 493,499 ----
  1713. X      if (cu->cu_XCCP != 1 || cu->cu_YCCP != 1)
  1714. X          getret();
  1715. X  
  1716. X!     CloseDevice((struct IORequest *) &ConsoleIO);
  1717. X      ConsoleDevice = NULL;
  1718. X      }
  1719. X      if (ConsoleIO.io_Message.mn_ReplyPort)
  1720. X***************
  1721. X*** 432,442 ****
  1722. X      if (HackWindow) {
  1723. X      register struct IntuiMessage *msg;
  1724. X  
  1725. X!     FindTask(NULL)->pr_WindowPtr = (APTR) pr_WindowPtr;
  1726. X      ClearMenuStrip(HackWindow);
  1727. X      Forbid();
  1728. X!     while (msg = GetMsg(HackWindow->UserPort))
  1729. X!         ReplyMsg(msg);
  1730. X      CloseWindow(HackWindow);
  1731. X      Permit();
  1732. X      HackWindow = NULL;
  1733. X--- 501,511 ----
  1734. X      if (HackWindow) {
  1735. X      register struct IntuiMessage *msg;
  1736. X  
  1737. X!     ((struct Process *) FindTask(NULL))->pr_WindowPtr = (APTR) pr_WindowPtr;
  1738. X      ClearMenuStrip(HackWindow);
  1739. X      Forbid();
  1740. X!     while (msg = (struct IntuiMessage *) GetMsg(HackWindow->UserPort))
  1741. X!         ReplyMsg((struct Message *) msg);
  1742. X      CloseWindow(HackWindow);
  1743. X      Permit();
  1744. X      HackWindow = NULL;
  1745. X***************
  1746. X*** 445,454 ****
  1747. X      CloseScreen(HackScreen);
  1748. X      HackScreen = NULL;
  1749. X      }
  1750. X!     /* if (IconBase) {
  1751. X      CloseLibrary(IconBase);
  1752. X      IconBase = NULL;
  1753. X!     } */
  1754. X  #ifdef HACKFONT
  1755. X      if (HackFont) {
  1756. X      CloseFont(HackFont);
  1757. X--- 514,523 ----
  1758. X      CloseScreen(HackScreen);
  1759. X      HackScreen = NULL;
  1760. X      }
  1761. X!     if (IconBase) {
  1762. X      CloseLibrary(IconBase);
  1763. X      IconBase = NULL;
  1764. X!     }
  1765. X  #ifdef HACKFONT
  1766. X      if (HackFont) {
  1767. X      CloseFont(HackFont);
  1768. X***************
  1769. X*** 471,477 ****
  1770. X      Initialized = 0;
  1771. X  }
  1772. X  
  1773. X! void abort(rc)
  1774. X  long rc;
  1775. X  {
  1776. X  #ifdef CHDIR
  1777. X--- 540,546 ----
  1778. X      Initialized = 0;
  1779. X  }
  1780. X  
  1781. X! void Abort(rc)
  1782. X  long rc;
  1783. X  {
  1784. X  #ifdef CHDIR
  1785. X***************
  1786. X*** 483,498 ****
  1787. X      getret();
  1788. X      } else
  1789. X      Alert(rc, 0L);
  1790. X      CleanUp();
  1791. X  #undef exit
  1792. X!     exit(rc);
  1793. X! }
  1794. X! 
  1795. X! /*  Used by library routines, and the debugger */
  1796. X! 
  1797. X! void _abort()
  1798. X! {
  1799. X!     abort(-10L);
  1800. X  }
  1801. X  
  1802. X  /*
  1803. X--- 552,575 ----
  1804. X      getret();
  1805. X      } else
  1806. X      Alert(rc, 0L);
  1807. X+ #ifdef LATTICE
  1808. X+     {
  1809. X+ /*    __emit(0x4afc);        /* illegal instruction */
  1810. X+     __emit(0x40fc);        /* divide by */
  1811. X+     __emit(0x0000);        /*  #0    */
  1812. X+         /* NOTE: don't move CleanUp() above here - */
  1813. X+         /* it is too likely to kill the system     */
  1814. X+         /* before it can get the SnapShot out, if  */
  1815. X+         /* there is something really wrong.       */
  1816. X+ __builtin_printf("abort botch");                /* (KL)TEMP */
  1817. X+     }
  1818. X+ #endif
  1819. X      CleanUp();
  1820. X  #undef exit
  1821. X! #ifdef AZTEC_C
  1822. X!     _abort();
  1823. X! #endif
  1824. X!     exit((int) rc);
  1825. X  }
  1826. X  
  1827. X  /*
  1828. X***************
  1829. X*** 504,517 ****
  1830. X      if (Initialized)
  1831. X      return;
  1832. X  
  1833. X!     if ( (IntuitionBase = OpenLibrary("intuition.library", LIBRARY_VERSION))
  1834. X        == NULL)
  1835. X!     abort(AG_OpenLib | AO_Intuition);
  1836. X  
  1837. X  #ifdef HACKFONT
  1838. X  
  1839. X!     if ( (GfxBase = OpenLibrary("graphics.library", LIBRARY_VERSION)) == NULL)
  1840. X!     abort(AG_OpenLib | AO_GraphicsLib);
  1841. X  
  1842. X      /*
  1843. X       *    Force our own font to be loaded, if possible.
  1844. X--- 581,594 ----
  1845. X      if (Initialized)
  1846. X      return;
  1847. X  
  1848. X!     if ( (IntuitionBase = OpenLibrary("intuition.library", INTUITION_VERSION))
  1849. X        == NULL)
  1850. X!     Abort(AG_OpenLib | AO_Intuition);
  1851. X  
  1852. X  #ifdef HACKFONT
  1853. X  
  1854. X!     if ( (GfxBase = OpenLibrary("graphics.library", GRAPHICS_VERSION)) == NULL)
  1855. X!     Abort(AG_OpenLib | AO_GraphicsLib);
  1856. X  
  1857. X      /*
  1858. X       *    Force our own font to be loaded, if possible.
  1859. X***************
  1860. X*** 522,528 ****
  1861. X       */
  1862. X  
  1863. X      if ((HackFont = OpenFont(&Hack80)) == NULL) {
  1864. X!     if (DiskfontBase = OpenLibrary("diskfont.library", LIBRARY_VERSION)) {
  1865. X          Hack80.ta_Name -= SIZEOF_DISKNAME;
  1866. X          HackFont = OpenDiskFont(&Hack80);
  1867. X          Hack80.ta_Name += SIZEOF_DISKNAME;
  1868. X--- 599,605 ----
  1869. X       */
  1870. X  
  1871. X      if ((HackFont = OpenFont(&Hack80)) == NULL) {
  1872. X!     if (DiskfontBase = OpenLibrary("diskfont.library", DISKFONT_VERSION)) {
  1873. X          Hack80.ta_Name -= SIZEOF_DISKNAME;
  1874. X          HackFont = OpenDiskFont(&Hack80);
  1875. X          Hack80.ta_Name += SIZEOF_DISKNAME;
  1876. X***************
  1877. X*** 532,539 ****
  1878. X      }
  1879. X  #endif
  1880. X  
  1881. X!     /* if ( (IconBase = OpenLibrary("icon.library", LIBRARY_VERSION)) == NULL)
  1882. X!     abort(AG_OpenLib | AO_IconLib); */
  1883. X  
  1884. X      /*
  1885. X       *    Now Intuition is supposed to use our HackFont for the screen,
  1886. X--- 609,616 ----
  1887. X      }
  1888. X  #endif
  1889. X  
  1890. X!     /* if ( (IconBase = OpenLibrary("icon.library", ICON_VERSION)) == NULL)
  1891. X!     Abort(AG_OpenLib | AO_IconLib); */
  1892. X  
  1893. X      /*
  1894. X       *    Now Intuition is supposed to use our HackFont for the screen,
  1895. X***************
  1896. X*** 541,556 ****
  1897. X       *    So, we need to do a SetFont() a bit later on.
  1898. X       */
  1899. X      if ( (HackScreen = OpenScreen(&NewHackScreen)) == NULL)
  1900. X!     abort(AN_OpenScreen & ~AT_DeadEnd);
  1901. X  
  1902. X      NewHackWindow.Screen = HackScreen;
  1903. X  
  1904. X      if ( (HackWindow = OpenWindow(&NewHackWindow)) == NULL)
  1905. X!     abort(AN_OpenWindow & ~AT_DeadEnd);
  1906. X  
  1907. X!     SetMenuStrip(HackWindow, &HackMenu);
  1908. X      {
  1909. X!     register struct Process *myProcess = FindTask(NULL);
  1910. X      pr_WindowPtr = (struct Window *)myProcess->pr_WindowPtr;
  1911. X      myProcess->pr_WindowPtr = (APTR) HackWindow;
  1912. X      }
  1913. X--- 618,637 ----
  1914. X       *    So, we need to do a SetFont() a bit later on.
  1915. X       */
  1916. X      if ( (HackScreen = OpenScreen(&NewHackScreen)) == NULL)
  1917. X!     Abort(AN_OpenScreen & ~AT_DeadEnd);
  1918. X! 
  1919. X! #ifdef TEXTCOLOR
  1920. X!     LoadRGB4(&HackScreen->ViewPort, palette, 8L);
  1921. X! #endif
  1922. X  
  1923. X      NewHackWindow.Screen = HackScreen;
  1924. X  
  1925. X      if ( (HackWindow = OpenWindow(&NewHackWindow)) == NULL)
  1926. X!     Abort(AN_OpenWindow & ~AT_DeadEnd);
  1927. X  
  1928. X!     SetMenuStrip(HackWindow, HackMenu);
  1929. X      {
  1930. X!     register struct Process *myProcess = (struct Process *) FindTask(NULL);
  1931. X      pr_WindowPtr = (struct Window *)myProcess->pr_WindowPtr;
  1932. X      myProcess->pr_WindowPtr = (APTR) HackWindow;
  1933. X      }
  1934. X***************
  1935. X*** 562,571 ****
  1936. X      ConsoleIO.io_Data = (APTR) HackWindow;
  1937. X      ConsoleIO.io_Length = sizeof(*HackWindow);
  1938. X      ConsoleIO.io_Message.mn_ReplyPort = CreatePort(NULL, 0L);
  1939. X!     if (OpenDevice("console.device", 0L, &ConsoleIO, 0L) != 0)
  1940. X!     abort(AG_OpenDev | AO_ConsoleDev);
  1941. X  
  1942. X!     ConsoleDevice = ConsoleIO.io_Device;
  1943. X  
  1944. X      Buffered = 0;
  1945. X      KbdBuffered = 0;
  1946. X--- 643,652 ----
  1947. X      ConsoleIO.io_Data = (APTR) HackWindow;
  1948. X      ConsoleIO.io_Length = sizeof(*HackWindow);
  1949. X      ConsoleIO.io_Message.mn_ReplyPort = CreatePort(NULL, 0L);
  1950. X!     if (OpenDevice("console.device", 0L, (struct IORequest *) &ConsoleIO, 0L) != 0)
  1951. X!     Abort(AG_OpenDev | AO_ConsoleDev);
  1952. X  
  1953. X!     ConsoleDevice = (struct Library *) ConsoleIO.io_Device;
  1954. X  
  1955. X      Buffered = 0;
  1956. X      KbdBuffered = 0;
  1957. X
  1958. END_OF_FILE
  1959. if test 53324 -ne `wc -c <'patch7.13'`; then
  1960.     echo shar: \"'patch7.13'\" unpacked with wrong size!
  1961. fi
  1962. # end of 'patch7.13'
  1963. echo shar: End of archive 19 \(of 30\).
  1964. cp /dev/null ark19isdone
  1965. MISSING=""
  1966. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ; do
  1967.     if test ! -f ark${I}isdone ; then
  1968.     MISSING="${MISSING} ${I}"
  1969.     fi
  1970. done
  1971. if test "${MISSING}" = "" ; then
  1972.     echo You have unpacked all 30 archives.
  1973.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1974. else
  1975.     echo You still need to unpack the following archives:
  1976.     echo "        " ${MISSING}
  1977. fi
  1978. ##  End of shell archive.
  1979. exit 0
  1980.